package myclasses;

import java.util.LinkedHashSet;
import java.util.Vector;

public class Student {
	private String id;
	private String firstName;
	private String middleInitial;
	private String lastName;
	private String citizenshipId;
	private String residenceId;
	private String specialization;
	private String citizenshipName;
	private String residenceName;
	private Address address;
	private LinkedHashSet<Degree> degrees;
	
	public Student() {	
	}
	
	public Student(String firstName, String middleInitial, String lastName) {
		this.address = null;
		this.firstName  = firstName;
		this.middleInitial = middleInitial;
		this.lastName = lastName;
		this.degrees = new LinkedHashSet<Degree>();
		this.residenceId = "";
		this.citizenshipId = "";
		this.id = "";
		this.citizenshipName = "";
		this.residenceName = "";
	}
	
	public LinkedHashSet<Degree> getDegrees () {
		return degrees;
	}
	
	public String getFirstName() {
		return firstName;
	}
	
	public String getMiddleInitial() {
		return middleInitial;
	}
	
	public String getLastName() {
		return lastName;
	}

	public String getCitizenshipId() {
		return citizenshipId;
	}
	
	public String getCitizenshipName() {
		return citizenshipName;
	}
	
	public String getId() {
		return id;
	}
	
	public String getResidenceId() {
		return residenceId;
	}
	
	public String getResidenceName() {
		return residenceName;
	}
	
	public String getSpecialization() {
		return specialization;
	}
	
	public Address getAddress() {
		return address;
	}
	
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	
	}
	
	public void setMiddleInitial(String middleInitial) {
		this.middleInitial = middleInitial;
	
	}
	
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public void setCitizenshipId(String citizenship) {
		this.citizenshipId = citizenship;
	}

	public void setResidenceId(String residence) {
		this.residenceId = residence;
	}
	
	public void setCitizenshipName(String citizenship) {
		this.citizenshipName = citizenship;
	}

	public void setResidenceName(String residence) {
		this.residenceName = residence;
	}
	
	public void setSpecialization(String specialization) {
		this.specialization = specialization;
	}

	public void setAddress(Address address) {
		this.address = address;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	public void addDegree(Degree deg) {
		this.degrees.add(deg);
	}
	
	public String printDegrees() {
		String ret = "";
		for (Degree d : degrees) {
			ret += d.printDegree();
		}
		return ret;
	}
	
	//old....
	public String printInfo(Vector countries) {	
		int rIndex = 0;
		int cIndex = 0;
		
		if(residenceId != "" && citizenshipId != "") {
			rIndex = Integer.parseInt(residenceId);
			cIndex = Integer.parseInt(citizenshipId);
		}
			
		Object resName = countries.get(rIndex);
		Object citName = countries.get(cIndex);
		
		String ret = "First name: " + firstName + "</br>";
		ret += "Middle initial: " + middleInitial + "</br>";
		ret += "Last name: " + lastName + "</br>";
		ret += "Citizenship: " + citName + "</br>";
		ret += "Residence: " + resName + "</br>";
		ret += "Specialization: " + specialization + "</br></br>";
		return ret;
	}
}
